package com.example.providerrest;

import com.example.dubbointerface.DemoService;
import org.apache.dubbo.config.annotation.DubboService;

import javax.ws.rs.*;

@DubboService
@Path("demo")
public class DemoServiceImpl implements DemoService {

    @GET
    @Path("hi")
    @Consumes({"application/json; charset=UTF-8", "text/xml; charset=UTF-8"}) // 设置请求头
    @Produces({"application/json; charset=UTF-8", "text/xml; charset=UTF-8"}) // 设置响应头
    @Override
    public String sayHi(@QueryParam("name") String name) {
        return "Hi, Rest -> " + name;
    }
}
